#ifndef  xStringValueInterface_h_h_h_h_h
#define xStringValueInterface_h_h_h_h_h

#include "XDefine.h"
#include <map>
#include "xHelp.h"


namespace XE	
{

	

	class XClass xStringValueInterface
	{
	protected:
		typedef void (xStringValueInterface::*SetPropertyFun)(const xString& value);
		typedef void  (xStringValueInterface::*GetPropertyFun)(xString& vaule);

		class   FunStrurct
		{
		public:
			FunStrurct(SetPropertyFun set,GetPropertyFun get)
				:m_SetFun(set),m_GetFun(get)
			{

			}

			SetPropertyFun m_SetFun;
			GetPropertyFun m_GetFun;

		};

		typedef std::map<xString,FunStrurct> SetPropertyMap;

	

	public:
	

		typedef SetPropertyMap::iterator PropertyMapIterator;

		xStringValueInterface()
		{};

		virtual ~xStringValueInterface(){};


		bool AddPropertyFun(const xString& name,GetPropertyFun getfun,SetPropertyFun setfun);

		bool RemovePropertyFun(const xString& name);

		bool  FindPropertyFun(const xString & name,GetPropertyFun& getfun,SetPropertyFun& setfun);

	   virtual	bool  GetProperty(const xString& name,xString& vauel);

 	   virtual	bool SetProperty(const xString& name,const xString& value);

		size_t GetPropertyCount(){return m_FunMap.size();}











	protected:

		SetPropertyMap m_FunMap;






	};




}














#endif